{% extends 'layout.html' %}
{% load mytags %}
{% block content %}
    <div>
        <a href="{% url_tag 'crm:class_add' request %}" class="btn btn-primary btn-sm">增加</a>
    </div>
    <form action="" method="get" class="form-inline pull-right">
        <input type="text" name="query" class="form-control">
        <button class="btn btn-sm btn-primary">查询</button>
    </form>
    <table class="table-hover table-bordered table">
        <thead>
        <tr>
            <th>序号</th>
            <th>班级名称</th>
            <th>学费</th>
            <th>开班日期</th>
            <th>结业日期</th>
            <th>班级类型</th>
            <th>老师</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for class in classes %}
            <tr>
                <td>{{ forloop.counter }}</td>
                <td>{{ class }}</td>
                <td>{{ class.price }}</td>
                <td>{{ class.start_date }}</td>
                <td>{{ class.graduate_date }}</td>
                <td>{{ class.get_class_type_display }}</td>
                <td>{{ class.show_teachers }}</td>
                <td>
                    <a class="btn btn-sm btn-danger"
                       href="{% url_tag 'crm:class_edit' request class.pk %}">编辑</a>
                    <a class="btn btn-sm btn-success"
                       href="{% url_tag 'crm:course_record_list' request class.pk %}">查看课程记录</a>
                </td>
            </tr>
        {% endfor %}

        </tbody>
    </table>
    <nav aria-label="Page navigation">
        <ul class="pagination">
            {{ page_html }}
        </ul>
    </nav>
{% endblock %}